<template>
    <div class="user_message">
        <el-form :inline="true" :model="formInline" class="demo-form-inline">
            <el-form-item label="审批人">
                <el-input v-model="formInline.user" placeholder="审批人"></el-input>
            </el-form-item>
            <el-form-item label="活动区域">
                <el-select v-model="formInline.region" placeholder="活动区域">
                    <el-option label="区域一" value="shanghai"></el-option>
                    <el-option label="区域二" value="beijing"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="onSubmit">查询</el-button>
            </el-form-item>
        </el-form>
        <el-button type="primary">批量删除</el-button>
        <el-button type="primary">添加</el-button>
        <el-table
            ref="multipleTable"
            :data="tableData"
            tooltip-effect="dark"
            style="width: 100%"
            @selection-change="handleSelectionChange">
            <el-table-column
                type="selection"
                width="55">
            </el-table-column>
            <el-table-column
                prop="id"
                label="用户名"
                width="120">
            </el-table-column>
            <el-table-column
                prop="avatar"
                label="密码"
                show-overflow-tooltip>
            </el-table-column>
            <el-table-column
                prop="password"
                label="密码"
                show-overflow-tooltip>
            </el-table-column>
            <el-table-column
                prop="email"
                label="密码"
                show-overflow-tooltip>
            </el-table-column>
            <el-table-column
                prop="telephone"
                label="密码"
                show-overflow-tooltip>
            </el-table-column>
            <el-table-column
                prop="birthday"
                label="密码"
                show-overflow-tooltip>
            </el-table-column>

            <el-table-column label="操作">
                <template v-slot="scope">
                    <el-button
                        size="mini"
                        @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
                    <el-button
                        size="mini"
                        type="danger"
                        @click="handleDelete(scope.$index, scope.row)">删除</el-button>
                </template>
            </el-table-column>
        </el-table>
        <div class="block">
            <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage4"
                :page-sizes="[100, 200, 300, 400]"
                :page-size="100"
                layout="total, sizes, prev, pager, next, jumper"
                :total="400">
            </el-pagination>
        </div>
    </div>
</template>
<style>
.user_message{
    margin: 20px 0px 0px 10px;
}
.user_message .el-table{
    margin-top: 10px;
}
.block{
    margin-top: 10px;
}
</style>
<script>
import axios from 'axios'
export default {
    data() {
        return {
            tableData: [],
            multipleSelection: [],
            formInline: {
                user: '',
                region: ''
            },
            currentPage1: 5,
            currentPage2: 5,
            currentPage3: 5,
            currentPage4: 4
        }
    },
    mounted() {

    },


    methods: {

        handleSelectionChange(val) {
            this.multipleSelection = val;
        },
        onSubmit() {
            console.log('submit!');
        },
        handleEdit(index, row) {
            console.log(index, row);
        },
        handleDelete(index, row) {
            console.log(index, row);
        },
        handleSizeChange(val) {
            console.log(`每页 ${val} 条`);
        },
        handleCurrentChange(val) {
            console.log(`当前页: ${val}`);
        }

    }
}
</script>